<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tbl</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="STRN">"table"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  2</span> 
<span class='line'>  3</span> </span><span class="NAME">chrome.extension.onRequest.addListener</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">request</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sender</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sendResponse</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  4</span> </span><span class="WHIT">  </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">request.type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="WHIT">    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"inject"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="WHIT">      </span><span class="NAME">sendResponse</span><span class="PUNC">(</span><span class="NAME">localStorage.inject</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="WHIT">      </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  8</span> </span><span class="WHIT">    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"get"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="WHIT">      </span><span class="NAME">sendResponse</span><span class="PUNC">(</span><span class="NAME">tbl.innerHTML</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">      </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">    </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">"disarm"</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT">      </span><span class="NAME">Investor.disarm</span><span class="PUNC">(</span><span class="NAME">request.secid</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request.trigger</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">save</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT">      </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT">    </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT">      </span><span class="NAME">sendResponse</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// snub</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT">      </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 19</span> 
<span class='line'> 20</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"secid"</span><span class="PUNC">,</span><span class="WHIT">        </span><span class="STRN">"text"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.secid</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"title"</span><span class="PUNC">,</span><span class="WHIT">        </span><span class="STRN">"text"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.title</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"value"</span><span class="PUNC">,</span><span class="WHIT">        </span><span class="STRN">"value"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"change"</span><span class="PUNC">,</span><span class="WHIT">       </span><span class="STRN">"change"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"pctChange"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="STRN">"pct"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"portValue"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="STRN">"value"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"dailyGain"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="STRN">"change"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"dailyPctGain"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"pct"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.change</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.change</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"totalGain"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="STRN">"change"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"totalPctGain"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"pct"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.pricePaid</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.value</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"pricePaid"</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="STRN">"value"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="NAME">Metrics.add</span><span class="PUNC">(</span><span class="STRN">"initInvest"</span><span class="PUNC">,</span><span class="WHIT">   </span><span class="STRN">"value"</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">  </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.count</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.pricePaid</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> 
<span class='line'> 41</span> </span><span class="NAME">Sources.add</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">  </span><span class="STRN">"bloomberg"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"http://www.bloomberg.com/apps/quote?ticker="</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">  </span><span class="STRN">"http://www.bloomberg.com/flashsrv/chart.swf"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"ticker={secid}"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">  </span><span class="NUMB">637</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">570</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"transparent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;title>.*?\:\s(.*?)(?:(?:\s|\/){0,2}(?:Inc|The|Group|Corp|\&amp\; Co)*?)*?\sSummary/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;span class="amount">([0-9,.]*?)&lt;/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;td class="name">Change&lt;\/td>\n&lt;td class="value.*?">(.*?)\s\(/</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="NAME">Sources.add</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">  </span><span class="STRN">"google"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"http://www.google.com/finance?q="</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">  </span><span class="STRN">"http://www.google.com/finance/chart9.swf"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"q={secid}&lcId=1269509101766&single_viewpoints=name%3AMainViewPoint%2Cheight%3A202%2CtopMargin%3A0&single_layers=vp%3AMainViewPoint%2Cname%3ADateLinesLayer%2Carity%3AUnique%2CtickPosition%3A0%2Ctype%3Asimple%2ChasText%3Atrue%3A%3Avp%3AMainViewPoint%2Cname%3APriceLinesLayer%2Carity%3AUnique%2Ctype%3Asimple%3A%3Avp%3AMainViewPoint%2Cname%3ALineChartLayer%2Carity%3AUnique%2Ctype%3Asimple%3A%3Avp%3AMainViewPoint%2Cname%3AAHLineChartLayer%2Carity%3AUnique%2Ctype%3Asimple%3A%3Avp%3AMainViewPoint%2Cname%3ALastDayLineLayer%2Carity%3AUnique%2Ctype%3Asimple%3A%3Avp%3AMainViewPoint%2Cname%3ABottomBarLayer%2Carity%3AUnique%2Ctype%3Asimple&compare_viewpoints=name%3AMainViewPoint%2Cheight%3A247%2CtopMargin%3A15&compare_layers=vp%3AMainViewPoint%2Cname%3APercentLinesLayer%2Carity%3AUnique%2Ctype%3Asimple%3A%3Avp%3AMainViewPoint%2Cname%3ADateLinesLayer%2Carity%3AUnique%2Ctype%3Asimple%2CtickPosition%3A0%3A%3Avp%3AMainViewPoint%2Cname%3ABottomBarLayer%2Carity%3AUnique%2Ctype%3Asimple%3A%3Avp%3AMainViewPoint%2Cname%3APercentLineChartLayer%2Carity%3AMultiple%2Ctype%3Asimple&u=http://www.google.com/finance/getprices&fieldSeparator=%2C&objectSeparator=%3A%3A&sparklineType=dynamic&disableExternalInterface=true"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">  </span><span class="NUMB">440</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">300</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"transparent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;title>(.*?)(?:\sInc\.)*?\:/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;span id="ref_[0-9]*?_l">([0-9,.]*?)&lt;/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;span class="chg?r?" id="ref_[0-9]*?_c">\+?(\-?[0-9,.]*?)&lt;/</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="NAME">Sources.add</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">  </span><span class="STRN">"yahoo"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"http://finance.yahoo.com/q?s="</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">  </span><span class="STRN">"http://us.js2.yimg.com/us.js.yimg.com/lib/fi/201008171841/us/swf/yfcv3/flashchart.swf"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">  </span><span class="STRN">"lcId=1284608380199&amp;localeUri=http%3A//us.js2.yimg.com/us.js.yimg.com/lib/fi/201008171841/us/locale/yfcv3/dictionary.xml&amp;chartHost=chartapi.finance.yahoo.com&amp;keyeventsHost=finance.yahoo.com&amp;sigdevsHost=ads.finance.yahoo.com&amp;buildType=prod&amp;state=symbol%3D{secid}%3Brange%3D1d%3Bindicator%3Dvolume%3Bcharttype%3Dline%3Bcrosshair%3Don%3Bohlcvalues%3D0%3Blogscale%3Don&amp;source=undefined"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">  </span><span class="NUMB">512</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">490</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"opaque"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">  </span><span class="REGX">/Summary\sfor\s(.*?)(?:(?:\s|,|\/){0,2}(?:Inc\.|The|Group|Corp|\&amp\; Co)*?)*?\-/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;span id="yfs_l10_.*?">(.*?)&lt;/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;span id="yfs_c10_.*?"[^>]+>.*?\n.*?\n.*?>(.*?)&lt;/</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="NAME">Sources.add</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">  </span><span class="STRN">"quote"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"http://www.quote.com/us/stocks/quote.action?s="</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">  </span><span class="STRN">"http://www.quote.com/beta/index.swf"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">  </span><span class="STRN">"ServerURL=http%3A//www.quote.com/feed/jmaf%3F&Symbols=%24INDU&Aggregation=5D&ShowToolbar=true&ShowHeader=true&HeaderFg=000000&HeaderBg=FFFFFF&XAxisFg=00025E&YAxisFg=00025E&XAxisBg=&YAxisBg=&ShowSymbolField=true&ShowToolbarGoBtn=true&ShowToolbarAddBtn=true&ShowToolbarChartTypeBtn=true&ChartType=line&ShowToolbarChartCursorBtn=true&ShowToolbarAggregationBtn=true&ShowToolbarChartSettingsBtn=true&ShowToolbarStudiesBtn=true&ShowValueMarkers=true&SymChangeCallback=switchMenu"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">  </span><span class="NUMB">900</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">450</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"transparent"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">  </span><span class="REGX">/&lt;li class="title">(.*?)\s\(.*?\)&lt;/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">  </span><span class="REGX">/Last\:\s&lt;span class="majors">(.*?)&lt;/</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">  </span><span class="REGX">/Chg\:\s&lt;span class=".*?">(.*?)&lt;/</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> 
<span class='line'> 76</span> </span><span class="COMM">// if (Settings.sync()) {</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="COMM">//   sync(function() { portfolios.load(); });</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="COMM">// } else {</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="COMM">//  Investor.load();</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="COMM">// }</span><span class="WHIT">
<span class='line'> 81</span> 
<span class='line'> 82</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">updateTable</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">  </span><span class="NAME">Investor.current</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">updateTable</span><span class="PUNC">(</span><span class="NAME">tbl</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 85</span> 
<span class='line'> 86</span> </span><span class="NAME">Investor.drawTable</span><span class="PUNC">(</span><span class="NAME">tbl</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="NAME">setInterval</span><span class="PUNC">(</span><span class="NAME">updateTable</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">15000</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> 
<span class='line'> 89</span> </span><span class="COMM">/*
<span class='line'> 90</span> $.ajax({
<span class='line'> 91</span>   url: "http://www.google.com/finance/portfolio?action=viewt&pid=1&output=csv",
<span class='line'> 92</span>   success: function(data) {
<span class='line'> 93</span>     var blah = {};
<span class='line'> 94</span>     var temp = data.split("\n");
<span class='line'> 95</span>     var isTopRow = true;
<span class='line'> 96</span>     $.each(temp, function(index, row) {
<span class='line'> 97</span>       if (!isTopRow) {
<span class='line'> 98</span>         var items = row.split(",");
<span class='line'> 99</span>         if (items[0] in blah) {
<span class='line'>100</span>           blah[items[0]] += parseFloat(items[4]);
<span class='line'>101</span>         } else {
<span class='line'>102</span>           blah[items[0]] = parseFloat(items[4]);
<span class='line'>103</span>         }
<span class='line'>104</span>       } else {
<span class='line'>105</span>         isTopRow = false;
<span class='line'>106</span>       }
<span class='line'>107</span>     });
<span class='line'>108</span>     // alert(JSON.stringify(blah));
<span class='line'>109</span>   }
<span class='line'>110</span> });
<span class='line'>111</span> */</span></pre></body></html>